﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using JWXH.XH.pages.mvvm.viewmodel;
using Xamarin.Forms;
using Xamarin.Forms.Xaml;

namespace JWXH.XH.pages.mvvm
{
    [XamlCompilation(XamlCompilationOptions.Compile)]
    public partial class MvvmTest1 : ContentPage
    {
        public MvvmTest1Model ViewModel { get; set; }
        public MvvmTest1()
        {
            InitializeComponent();
            BindingContext = ViewModel = new MvvmTest1Model();
        }

        private void BtnAdd100_OnClick(object sender, EventArgs e)
        {
            ViewModel.TotalPrice += 100;
        }

        private void Switch_OnToggled(object sender, ToggledEventArgs e)
        {
            ViewModel.IsCheck200 = true;
        }
    }
}